package com.my.study.springframework.bean.factory;

import com.my.study.springframework.bean.BeansException;

/**
 * Bean工厂
 *
 * @author: yidujun
 * @create: 2021/06/10 11:16
 */
public interface BeanFactory {

    /**
     * 根据beanName获取对象实例
     *
     * @param beanName
     * @throws BeansException
     * @return
     */
    Object getBean(String beanName) throws BeansException;

    /**
     * 根据参数获取对象实例
     *
     * @param name
     * @param args
     * @return
     * @throws BeansException
     */
    Object getBean(String name, Object... args) throws BeansException;

    /**
     * 获取bean
     *
     * @param name
     * @param requiredType
     * @param <T>
     * @return
     */
    <T> T getBean(String name, Class<T> requiredType);
}
